﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkflowCore2210A.Domain.Model
{
    /// <summary>
    /// 流程设计（定义流程审批的步骤）
    /// </summary>
    [Table("WorkflowDefinition")]
    public class WorkflowDefinitionModel:BaseEntity
    {
        /// <summary>
        /// 流程设计的标识
        /// </summary>
        [MaxLength(100)]
        public string DefinitionId { get; set; }
        public int Version { get; set; }
        /// <summary>
        /// 流程设计的标题（出差、请假、转正申请、加班申请）
        /// </summary>
        [MaxLength(100)]
        public string Title { get; set; }

        /// <summary>
        /// 审批步骤 由<see cref="StepNode"/> 集合序列化而成
        /// </summary>
        [Column(TypeName ="json")]
        public string Steps { get; set; }
    }

    /// <summary>
    /// 审批节点
    /// </summary>
    public class StepNode
    {
        /// <summary>
        /// 步骤ID
        /// </summary>
        public string StepId { get; set; }
        /// <summary>
        /// 步骤名称
        /// </summary>
        public string StepName { get; set; }
        /// <summary>
        /// 下一个步骤ID
        /// </summary>
        public string NextStepId { get; set; }
        /// <summary>
        /// 审批人ID
        /// </summary>
        public long AuditUserId { get; set; }
        /// <summary>
        /// 审批人姓名
        /// </summary>
        public string AuditUserName { get; set; }
    }
}
